package cn.jiyun.service;

import cn.jiyun.mapper.EmpMapper;
import cn.jiyun.pojo.Emp;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class EmpService {
    @Autowired
    EmpMapper empMapper;

    public List<Emp> findAll(){
        return empMapper.selectAll();
    }

    public List<Emp> findAllEmp(Emp emp) {
        return empMapper.findAllEmp(emp);
    }

    public void insertEmp(Emp emp) {
        empMapper.insertSelective(emp);
    }

    public Emp findById(int eid) {
        return empMapper.findById(eid);
    }

    public void updateById(Emp emp) {
        empMapper.updateByPrimaryKeySelective(emp);
    }

    public void deleteById(int eid) {
        empMapper.deleteById(eid);
    }
}
